<?php
class Login_ctl extends Ctl{
    function __construct(){
    }
    function main(array $xxfget) {
        $uname=$_POST["username"];
        $pwd=$_POST["password"];
		//echo "select id from user where username='$uname' and password='$pwd'";exit();
        $uid= xdb::getInstance()->getvar("select id from user where username='$uname' and password='$pwd'");
        if($uid){
            $_SESSION["uid"]=$uid;
            xdb::getInstance()->getdb()->query("update user set lnum=lnum+1 where id = $uid");
            echo 1;
        }else{
            echo 0;
        }
    }
}